<?php
class Zend_View_Helper_Checklogin {
    function checklogin() {
        if (Zend_Auth::getInstance()->hasIdentity()) {
            $role=Zend_Auth::getInstance()->getIdentity();
            if ($role->Role=='admin') {
                $display ="<a href='/index/logout'>Logout</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='/admin'>Admin</a>";
            } else {
                $display ="<a href='/index/logout'>Logout</a>";
            }

        }
        else {
            $display ="<a href='/login'>Login</a>";
        }

        return $display;
    }
}